home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / trim < prev    next >
Text File  |  1999-07-30  |  1KB  |  33 lines

  1. SYNOPSIS
  2.  
  3.         #include <strings.h>
  4.  
  5.         string trim (string s)
  6.         string trim (string s, int where)
  7.         string trim (string s, int where, int ch)
  8.         string trim (string s, int where, string ch)
  9.  
  10. DESCRIPTION
  11.         Remove all leading and trailing characters <ch> from the string
  12.         <s> and return the new string.
  13.  
  14.         <ch> may be given as a single character, or a string of characters.
  15.         If <ch> is not given, it defaults to the whitespace " \t".
  16.  
  17.         <where> can be used to modify where the characters are removed:
  18.  
  19.           TRIM_LEFT  (1):      remove the leading characters
  20.           TRIM_RIGHT (2):      remove the trailing characters
  21.           TRIM_BOTH  (3 or 0): remove both leading and trailing characters
  22.  
  23. EXAMPLE
  24.         trim("   1234   ")                  --> "1234"
  25.         trim("   1234   ", TRIM_RIGHT)      --> "   1234"
  26.         trim("   1234   ", TRIM_BOTH, " 1") --> "234"
  27.  
  28. HISTORY
  29.         Introduced in LDMud 3.2.7.
  30.  
  31. SEE ALSO
  32.         regreplace(E)
  33.